const webpack = require('webpack');
const path = require('path');
const fs = require('fs');

const resolve = {
    extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
    modules: [
        path.resolve(__dirname, 'node_modules'),
    ]
};
const module_loader = {
    rules: [{
        test: /\.tsx?$/,
        exclude: /node_modules/,
        loader: 'ts-loader'
    }]
};

const config_library = {
    mode: "development",
    context: path.join(__dirname, 'src'),
    resolve,
    node: {
        __dirname: false
    },
    module: module_loader,
    entry: {
        "index": "./index",
    },
    output: {
        path: path.join(__dirname, 'out'),
        filename: 'dist/bundle.js',

    },
    plugins: [
    ]
};

module.exports = [config_library];